package com.shujia.flink.source;

import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

import java.util.ArrayList;

public class Demo03CollectionSource {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

        ArrayList<String> arr = new ArrayList<>();

        arr.add("java,scala,python");
        arr.add("java,scala,python");
        arr.add("java,scala,python");
        arr.add("java,scala,python");


        /**
         * 基于本地集合的Source
         */
        DataStream<String> arrDS = env.fromCollection(arr);

        arrDS.print();

        env.execute();

    }
}
